#include<stdlib.h>
#include<stdio.h>
#include<errno.h>
#include<string.h>
#include<error.h>

int main(int argc,char **argv){

   if(argc<3){
    printf(" 参数不足三个 \n");
    exit(0);
   }
    FILE *fsrc = NULL;
    FILE *fdes = NULL;
    int tmp ;

    fsrc = fopen(argv[1],"r");
    if(fsrc == NULL){
        perror("源文件出错");
        exit(0);
    }

    fdes = fopen(argv[2],"w");
    if (fdes == NULL)
    {
       perror("目标文件出错");
    }
    
    while (1)
    {
        tmp = getc(fsrc);
        if(tmp == EOF ) break;
        putc(tmp,fdes);
    }
    
    fclose(fsrc);
    fclose(fdes);

   return 0;
}